package com.banmao.greedysnake;

import com.banmao.greedysnake.gamepanel.controller.GamePanelCcontroller;
import de.felixroske.jfxsupport.AbstractJavaFxApplicationSupport;
import javafx.application.Platform;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class FXMain extends AbstractJavaFxApplicationSupport {

    @Override
    public void stop() throws Exception {
        super.stop();
        log.info("stop前");

        // 关闭计时器
        if(GamePanelCcontroller.timer != null) {
            GamePanelCcontroller.timer.cancel();
        }

        Platform.exit();
    }
}
